package com.hskn.hss.module.inspectionCfg.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hskn.hss.core.annotation.DataScope;
import com.hskn.hss.core.page.TableDataInfo;
import com.hskn.hss.exception.ExcelReaderDataException;
import com.hskn.hss.exception.HssException;
import com.hskn.hss.module.inspectionCfg.entity.TlInspectionCfg;
import com.hskn.hss.module.inspectionCfg.to.*;
import com.hskn.hss.module.inspectionCfg.vo.TlInspectionCfgDetailVO;
import com.hskn.hss.module.user.entity.User;
import com.hskn.hss.to.ForIdsTO;
import org.springframework.transaction.annotation.Transactional;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author hskn
 * @since 2021-05-06
 */
public interface ITlInspectionCfgService extends IService<TlInspectionCfg> {

    @Transactional(rollbackFor = {RuntimeException.class, Error.class})
        //添加事务
    int update(UpdateTlInspectionCfgTO updateTlInspectionCfgTO);

    @Transactional(rollbackFor = {RuntimeException.class, Error.class})
        //添加事务
    int insert(InsertTlInspectionCfgTO insertTlInspectionCfgTO);

    @Transactional(rollbackFor = {RuntimeException.class, Error.class})
    int deleteByid(ForIdsTO forIdsTO);

    List<TlInspectionCfg> selectList(QueryWrapper<TlInspectionCfg> queryWrapper);

    void excelReader(List<TlInspectionCfg> inspectionCfgList) throws ExcelReaderDataException;

    TlInspectionCfgDetailVO getDetailById(TlInspectionCfgTOForOnlyId inspectionCfgTOForOnlyId) throws HssException;


    @DataScope(deptAlias = "deptidforcar", userAlias = "creatBy")
    List<TlInspectionCfg> getTlInspectionCfgList(InspectionCfgListTO inspectionCfgListTo, SimpleDateFormat format) throws ParseException;

    TableDataInfo getList(InspectionCfgListForPageTO inspectionCfgListForPageTO) throws ParseException;
}
